package com.wh1200.mybatis.xmlless.model.criteria

import com.wh1200.kotlin.isNotNullAndNotBlank
import com.wh1200.mybatis.xmlless.AnnotatedElementDetailInfo

/**
 * 可选参数
 *
 * @author 吴昊
 * @date 2023/12/06
 * @version 1.0
 * @since v4.0.0
 */
class OptionalParam(
    private val prefix: String?,
    val name: String,
    val element: AnnotatedElementDetailInfo
) {

  fun name(): String {
    if (prefix.isNotNullAndNotBlank()) {
      return "$prefix.$name"
    }
    return name
  }

}
